package util;

import util.TestUtils;
import org.springframework.jdbc.datasource.DriverManagerDataSource;

import javax.naming.NamingException;

/**
 * @author janm
 */
public abstract class DaoDemoUtils {
    
    public static void buildJndi() {
        try {
            TestUtils.NamingContextBuilder builder;
            builder = TestUtils.NamingContextBuilder.emptyActivatedContextBuilder();

            String connectionString = "jdbc:mysql://localhost:3306/website";
            builder.bind("java:comp/env/jdbc/mysql", new DriverManagerDataSource(
                    "com.mysql.jdbc.Driver", connectionString, "root", "chen"));
        } catch (NamingException e) {
            // noop
        }
    }

}
